import request from '@/request'

export function selectArticle(formdata) {
  return request({
    url: '/article/select',
    method: 'post',
    data: formdata
  })
}

export function hotArticle() {
  return request({
    url: '/article/hot',
    method: 'post'
  })
}

export function getViewCount() {
  return request({
    url: '/article/view',
    method: 'get'
  })
}

export function addArticle(formdata) {
  return request({
    url: '/article/add',
    method: 'post',
    data: formdata
  })
}

export function updateArticle(formdata) {
  return request({
    url: '/article/update',
    method: 'post',
    data: formdata
  })
}

export function deleteArticle(id) {
  return request({
    url: `/article/delete/${id}`,
    method: 'post'
  })
}

export function topArticle(formdata) {
  return request({
    url: '/article/top',
    method: 'post',
    data: formdata
  })
}